package com.uzai.console.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 支付宝账单支付类型
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum ExportInfoTypeEnum {
    EXPORT_INFO_TB_ORDER(1, "tb_order", "淘宝订单"),
    EXPORT_INFO_JD_ORDER(2, "jd_order", "京东订单"),
    EXPORT_INFO_VPH_ORDER(3, "vph_order", "唯品会订单"),
    EXPORT_INFO_PDD_ORDER(4, "pdd_order", "拼多多订单"),
    EXPORT_INFO_MT_ORDER(5, "mt_order", "美团订单"),
    EXPORT_INFO_ELM_ORDER(6, "elm_order", "饿了么订单"),
    EXPORT_INFO_WECHAT_USER(7, "wechat_user", "个人微信用户"),
    EXPORT_INFO_WXWORK_USER(8, "wxwork_user", "企业微信用户"),
    EXPORT_INFO_WXPUB_USER(9, "wxpub_user", "公众号用户"),
    EXPORT_INFO_MINIPRO_USER(10, "minipro_user", "小程序用户"),
    EXPORT_INFO_TAKE_BAL(11, "take_bal", "提现列表"),
    EXPORT_INFO_RED_PACKET(12, "red_packet", "红包列表"),
    EXPORT_INFO_WXCONTACTS(13,"wxcontacts","个人微信通讯录"),
    EXPORT_INFO_WXWORKCONTACTS(14,"wxworkcontacts","企业微信通讯录"),
    EXPORT_INFO_TB_PUSISH_ORDER(15, "tb_punish_order", "淘宝处罚订单"),
    EXPORT_INFO_FANS_VALUE_REPORT(16, "fans_value_report", "粉丝价值报表"),
    EXPORT_INFO_ORDER_REVENUE_REPORT(17, "order_revenue_report", "订单收益报表"),
    EXPORT_INFO_EXPENSE_COUNT_REPORT(18, "expense_count_report", "支出统计报表"),
    EXPORT_INFO_ROBOT_DATA_REPORT(19, "robot_data_report", "机器人数据报表"),
    ;

    private Integer id;
    private String key;
    private String desc;

    ExportInfoTypeEnum(Integer id, String key, String desc) {
        this.id = id;
        this.key = key;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static ExportInfoTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (ExportInfoTypeEnum type: ExportInfoTypeEnum.values()) {
            if (type.getId().intValue() == id.intValue()) {
                return type;
            }
        }
        return null;
    }

    public static ExportInfoTypeEnum getByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (ExportInfoTypeEnum type: ExportInfoTypeEnum.values()) {
            if (type.getKey().equals(key)) {
                return type;
            }
        }
        return null;
    }
}
